package com.ssyt.ssh.sys.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestParam;

import com.ssyt.ssh.common.BaseDao;
import com.ssyt.ssh.sys.dao.BlogUserDao;
import com.ssyt.ssh.sys.entity.BlogUser;

@Repository
public class BlogUserDaoImpl extends BaseDao<BlogUser, Integer> implements
		BlogUserDao {

	@Override
	public BlogUser login(String code, String password) {
		String str = "from BlogUser where code=? and password=?";
		return uniqueEntityByHql(str, code, password);
	}

	@Override
	public Integer add(BlogUser blogUser) {
		blogUser.getCode();
		blogUser.getPassword();
		return save(blogUser);
	}

	@Override
	public List<BlogUser> listUser() {
		String str = "select * from user";
		return listEntityBySql(str);
	}
}
